<template>
	<view  >
		<view class="comment">
			<view class="comment_list flex-s" v-for="(item,index) in list" :key="index">
				<view class="icons flex-c"><u-image src="/static/images/xciaoz@2x.png" mode="aspectFit" width="12px"
						height="12px"></u-image></view>
				<view class="content flex-c">
					<view class="head">
						<app-avatar :src="item.avatar" :userId="item.userId" randomBgColor size="22px" fontSize="11px"></app-avatar>
					</view>
					<view class="list_content">
						<view class="list_title flex-s">
							<view>{{item.createName || item.nickName}}</view>
							<view>{{item.createTime}}</view>
						</view>
						<view class="desc">{{item.content}}</view>
						<view class="imgs flex-c">
							<view class="imgs_son" v-for="(vo,idx) in imageList(item.picture)" :key="idx">
								<u-image :src="vo" mode="aspectFill" width="50px" height="50px"
									@click="previewImage(vo,imageList(item.picture))"></u-image>
							</view>
						</view>
					</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		name: "commentList",
		props: {
			list: {
				type: Array,
				default: () => []
			}
		},
		computed: {
			imageList() {
				return (picture) => {
					const imgs = picture && picture.split(',') || []
					return imgs
				}

			}
		},
		data() {
			return {

			};
		},
		methods:{
			previewImage(url,imgs) {
				uni.previewImage({
					urls: imgs,
					current: url,
				})
			}
		}
	}
</script>

<style scoped lang="scss">
 
	.imgs {
		padding: 5px 0;
		justify-content: flex-start;
	
		.imgs_son {
			margin: 0 8px 0 0;
			border-radius: 4px;
			overflow: hidden;
		}
	}
	.comment {
		// background: #F8F8F8;
		border-radius: 5px;
		// margin: 15px;


	}

	.comment_list {
		align-items: flex-start;
		border-bottom: 1px solid #EDEDED;
		padding: 13px;

		&:nth-last-child(1) {
			border-bottom: none;
		}

		.icons {
			height: 22px;
			margin-right: 5px;
		}

		.content {
			flex: 1;
			align-items: flex-start;

			.list_content {
				flex: 1;
				margin-left: 5px;


				.list_title {
					font-size: 14px;
					height: 22px;
					font-weight: normal;
					color: #999999;
				}



				.desc {
					font-size: 14px;
					color: #333333;
					line-height: 20px;
					margin-top: 2px;

				}

				.address {
					color: #0055A6;
					font-size: 14px;

					font {
						margin-left: 5px;
					}
				}


			}
		}
	}
</style>